package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Citycoordinateslist;
import com.ean.backpack.repository.CitycoordinateslistRepository;
import com.ean.backpack.service.CitycoordinateslistService;

@Service
@Transactional
public class CitycoordinateslistServiceImpl implements
		CitycoordinateslistService {

	@Autowired
	CitycoordinateslistRepository citycoordinateslistRepository;

	public long countAllCitycoordinateslists() {
		return citycoordinateslistRepository.count();
	}

	public void deleteCitycoordinateslist(
			Citycoordinateslist citycoordinateslist) {
		citycoordinateslistRepository.delete(citycoordinateslist);
	}

	public Citycoordinateslist findCitycoordinateslist(Integer id) {
		return citycoordinateslistRepository.findOne(id);
	}

	public List<Citycoordinateslist> findAllCitycoordinateslists() {
		return citycoordinateslistRepository.findAll();
	}

	public List<Citycoordinateslist> findCitycoordinateslistEntries(
			int firstResult, int maxResults) {
		return citycoordinateslistRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void saveCitycoordinateslist(Citycoordinateslist citycoordinateslist) {
		citycoordinateslistRepository.save(citycoordinateslist);
	}

	public Citycoordinateslist updateCitycoordinateslist(
			Citycoordinateslist citycoordinateslist) {
		return citycoordinateslistRepository.save(citycoordinateslist);
	}
}
